home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 245 / gfatip16 / strippat.lst < prev   
File List  |  1988-10-10  |  821b  |  27 lines

  1. ' GFATIP16 .LST Library Source Code is Copyright 1988 Marathon Computer Press
  2. ' Procedure: Strip_file_path
  3. ' Dependencies : None
  4. '
  5. '   This is the little piece of magic that separates the full path as passed
  6. ' to the calling application by the standard Fileselector.  Close observation
  7. ' will reveal what we've done.
  8. '
  9. '
  10. Procedure Strip_file_path
  11.   Local Size%
  12.   Clr Newdrive$,Newdrive%,Path$,Fsel$
  13.   Size%=Len(Nowhere$)
  14.   Currentdir$=Dir$(0)
  15.   For Strippat%=Size% To 1 Step -1
  16.     If Mid$(Nowhere$,Strippat%,1)="\" Then
  17.       Fsel$=Right$(Nowhere$,(Size%-Strippat%))
  18.       Path$=Left$(Nowhere$,(Len(Nowhere$)-Len(Fsel$)))
  19.       If Mid$(Path$,2,1)=":"
  20.         New_drive$=Left$(Path$,1)
  21.         Newdrive%=Asc(New_drive$)-Asc("A")+1
  22.       Endif
  23.       Strippat%=1
  24.     Endif
  25.   Next Strippat%
  26. Return
  27.